package org.qydjk.common.ueditor.define;

import java.util.HashMap;
import java.util.Map;

/**
 * 定义请求action类型
 * @author hancong03@baidu.com
 *
 */
@SuppressWarnings("serial")
public final class ActionMap {

	public static final Map<String, Integer> mapping;
	// 获取配置请求
	public static final int CONFIG = 0;
	public static final int UPLOAD_IMAGE = 1;
	public static final int UPLOAD_SCRAWL = 2;
	public static final int UPLOAD_VIDEO = 3;
	public static final int UPLOAD_FILE = 4;
	public static final int CATCH_IMAGE = 5;
	public static final int LIST_FILE = 6;
	public static final int LIST_IMAGE = 7;

	public static final String CONFIG_STRING = "config";
	public static final String UPLOAD_IMAGE_STRING = "uploadimage";
	public static final String UPLOAD_SCRAWL_STRING = "uploadscrawl";
	public static final String UPLOAD_VIDEO_STRING = "uploadvideo";
	public static final String UPLOAD_FILE_STRING = "uploadfile";
	public static final String CATCH_IMAGE_STRING = "catchimage";
	public static final String LIST_FILE_STRING = "listfile";
	public static final String LIST_IMAGE_STRING = "listimage";
	
	static {
		mapping = new HashMap<String, Integer>(){{
			put( CONFIG_STRING, ActionMap.CONFIG );
			put( UPLOAD_IMAGE_STRING, ActionMap.UPLOAD_IMAGE );
			put( UPLOAD_SCRAWL_STRING, ActionMap.UPLOAD_SCRAWL );
			put( UPLOAD_VIDEO_STRING, ActionMap.UPLOAD_VIDEO );
			put( UPLOAD_FILE_STRING, ActionMap.UPLOAD_FILE );
			put( CATCH_IMAGE_STRING, ActionMap.CATCH_IMAGE );
			put( LIST_FILE_STRING, ActionMap.LIST_FILE );
			put( LIST_IMAGE_STRING, ActionMap.LIST_IMAGE );
		}};
	}
	
	public static int getType ( String key ) {
		return ActionMap.mapping.get( key );
	}
	
}
